﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RendicionDocGrid.ascx.cs" 
Inherits="UILGestion.ObraAdmin.RendicionCaja.RendicionDocGrid" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    .style1
    {
        width: 100%;
    }
    .style2
    {
        height: 23px;
    }
</style>
<input id="idParent" type="hidden"  runat="server"/>
<input id="idColeccion" type="hidden"  runat="server"/>


<asp:GridView ID="itemGridView" runat="server"  Font-Size="X-Small"
                              AutoGenerateColumns="False" 
                              CellPadding="4" DataKeyNames="idInternal"  
                              SkinID="GridView"
                               onrowcancelingedit="CancelItem" 
                            onrowediting="EditItem" 
                            OnRowUpdating="UpdateItem" 
                              ShowHeader="false">
                              <Columns>
  <asp:TemplateField HeaderText="FECHA" HeaderStyle-Width="110px" ItemStyle-VerticalAlign="Top" >
                                    <ItemTemplate>
                                      <table >
    <tr>
        <td align="right" width="100px" >
            Fecha Emision:</td>
        <td width="250px" >
            <asp:Label ID="fechaEmisionLBL" runat="server" Text='<%# Eval("fechaEmisionStr")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            Fecha Vencimiento:</td>
        <td>
            <asp:Label ID="fechaVencimientoLBL" runat="server" Text='<%# Eval("fechaVencimientoStr")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            tipo Cambio:</td>
        <td>
            <asp:Label ID="tipoCambioLBL" runat="server" Text='<%# Eval("tipoCambio")%>'></asp:Label>
        </td>
    </tr>
</table>
                                   </ItemTemplate>
                                    <EditItemTemplate>

    <table >
    <tr>
        <td align="right" width="100px" >
            Fecha Emision</td>
        <td width="250px">

        <asp:TextBox ID="fechaEmisionTxt" runat="server" Text='<%# Eval("fechaEmisionStr")%>' Width="70px" TabIndex="5" />
        <asp:ImageButton ID="ImageButton1" runat="Server" AlternateText="Click aqui para mostrar calendario" font-names="Arial" 
                                              Font-Size="X-Small" ImageUrl="~/Images/month.gif"  />
                                              <asp:CalendarExtender ID="CalendarExtender2" runat="server"     
                                                     TargetControlID="fechaEmisionTxt"
                                                       PopupButtonID="ImageButton1"></asp:CalendarExtender>

           
        </td>
    </tr>
    <tr>
        <td align="right">
            Fecha Vencimiento</td>
        <td>


        <asp:TextBox ID="fechaVencimientoTXT" runat="server" Text='<%# Eval("fechaVencimientoStr")%>' Width="70px" TabIndex="6"/>
        <asp:ImageButton ID="ImageButton2" runat="Server" AlternateText="Click aqui para mostrar calendario" font-names="Arial" 
                                              Font-Size="X-Small" ImageUrl="~/Images/month.gif"  />
                                              <asp:CalendarExtender ID="CalendarExtender1" runat="server"     
                                                     TargetControlID="fechaVencimientoTXT"
                                                       PopupButtonID="ImageButton2"></asp:CalendarExtender>
        
           
        </td>
    </tr>
    <tr>
        <td align="right">
            tipo Cambio:</td>
        <td>
         <lib:Input ID="tipoCambioTXT" runat="server" Text='<%# Eval("tipoCambio")%>' Width="70px" TabIndex="7" />
            <lib:Input ID="idProveedorTXT" runat="server" backcolor="Transparent"  
                                        ReadOnly="true" BorderStyle="None" Text='<%# Eval("idProveedor")%>'
                                          Width="0px"/>
            <lib:Input ID="proveedor1TXT" runat="server" backcolor="Transparent"  
                                        ReadOnly="true" BorderStyle="None" Text='<%# Eval("proveedor")%>'
                                          Width="0px"/>
            <asp:TextBox ID="idTipoDocumentoTXT" runat="server" BorderStyle="None" backcolor="Transparent" Text='<%# Eval("tipoDoc")%>' ReadOnly="true"
                                        width="0px" />

        </td>
    </tr>
</table>
       </EditItemTemplate>
</asp:TemplateField>


  <asp:TemplateField HeaderText="DOCUMENTO" HeaderStyle-Width="350px"  ItemStyle-VerticalAlign="Top">
<ItemTemplate>

<table >
    <tr>
        <td align="right">
            T/D:</td>
        <td>
           <asp:Label ID="tipodocumentoDDL" runat="server" Text='<%# Eval("tipodocumentoStr")%>' /><br />
        </td>
     </tr>
        <tr>
        <td align="right">
            Num.:
        </td>
        <td>
        <asp:Label ID="documentolbl" runat="server" Text='<%# Eval("numdocumento")%>' />
        </td>
    </tr>
    <tr>
        <td align="right" valign="top">
            RUC:</td>
        <td>
            <asp:Label ID="rucDNIBL" runat="server" Text='<%# Eval("RUC")%>'></asp:Label>
        </td>
        </tr>
        <tr>
        <td align="right">Razón Social:</td>
        <td>
            <asp:Label ID="proveedorLBL" runat="server" Text='<%# Eval("proveedor")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            Glosa:</td>
        <td>
            <asp:Label ID="glosaLBL" runat="server" Text='<%# Eval("glosa")%>'></asp:Label>
        </td>
    </tr>
   
</table>


                                        
                                       </ItemTemplate>
                                         <EditItemTemplate>
                                           
                                           
<table >
    <tr>
        <td align="right">
            Documento:</td>
        <td>
            <asp:DropDownList ID="tipodocumentoDDL" runat="server"  Width="200px" TabIndex="8" Enabled="false" />
            
            <asp:TextBox ID="documentoTXT" runat="server" Text='<%# Eval("numdocumento")%>' TabIndex="9"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td align="right">
            Proveedor:</td>
        <td>
            
            <table>
            <tr>
            <td><b>RUC:</b><lib:Input ID="rucTXT" runat="server" Text='<%# Eval("ruc")%>' Width="70px" BackColor="Transparent"   ReadOnly="true"></lib:Input>
                                        </td>
                                        <td>
                                        
            <lib:Input ID="proveedorTxt" runat="server" backcolor="#DFE8F6" Text='<%# Eval("proveedor")%>' 
                                          DataType="List"  NumColum="2" onchange="javascript:validarProveedor(this);" 
                                          method="GetProveedor" TabIndex="10"
                                          OnSelect="SelectProveedor" Width="250px"  /> 
                                        
                                        </td>
            </tr>
            </table>
                                          
        </td>
    </tr>
    <tr>
        <td align="right">
            Glosa:</td>
        <td>
           <lib:Input ID="glosaTXT" runat="server" Text='<%# Eval("glosa")%>' TabIndex="11"
            backcolor="#DFE8F6" Width="350px" NumColum="0" ChkVal='<%# Eval("idOrden")%>' 
             DataType="List" method="GetOrdenCompraItem"    />


                            
        </td>
    </tr>
   
</table>
 </EditItemTemplate>

                                     
  </asp:TemplateField>
                        
  
  <asp:TemplateField HeaderText="TOTAL" HeaderStyle-Width="350px" ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Top"
  ItemStyle-BackColor="LightYellow">
   <ItemTemplate>
          
  <asp:Panel ID="totalDocuemntoPNL" runat="server"  Visible='<%# Eval("isDocumento")%>'>
            <table >
    <tr>
        <td align="right">
            Base Imponible: </td>
        <td width="100px" align="right">
            <asp:Label ID="totalLBL" runat="server" Text='<%# Eval("netoDoc")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right" >
            Base Inafecto:</td>
        <td align="right" >
            <asp:Label ID="totalLBL0" runat="server" Text='<%# Eval("impInafecto")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            IGV 18 %:</td>
        <td align="right">
            <asp:Label ID="totalLBL1" runat="server"  Text='<%# Eval("igvDoc")%>' ></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            ISC:</td>
        <td align="right">
            <asp:Label ID="totalLBL2" runat="server" Text='<%# Eval("impISC")%>'></asp:Label>
        </td>
    </tr>


      <tr>
        <td align="right">
            Total</td>
        <td align="right">
            <asp:Label ID="Label1" runat="server" Text='<%# Eval("totalDoc")%>'></asp:Label>
        </td>
    </tr>
</table>
</asp:Panel>                             

<asp:Panel ID="totalHonorarioPNL" runat="server"  Visible='<%# Eval("isHonorario")%>'>
            <table >
    <tr>
        <td align="right">
            Importe Honorario:</td>
        <td width="100px" align="right">
            <asp:Label ID="totalLBL3" runat="server" Text='<%# Eval("totalDoc")%>'></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            Ret. Renta 4ta:</td>
        <td align="right">
            <asp:Label ID="totalLBL4" runat="server" Text='<%# Eval("Renta4ta")%>' ></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="right">
            Importe Neto:</td>
        <td align="right">
            <asp:Label ID="totalLBL5" runat="server" Text='<%# Eval("importeNeto")%>'></asp:Label>
        </td>
    </tr>
</table>

</asp:Panel> 

    </ItemTemplate>
        <EditItemTemplate>
               <asp:Panel ID="totalDocuemntoPNL" runat="server"  Visible='<%# Eval("isDocumento")%>'>                                      
            <table >
    <tr>
        <td align="right">
            Base Imponible: </td>
        <td width="100px" align="right">
            <lib:Input ID="baseImponibleTXT" runat="server" Text='<%# Eval("netoDoc")%>' TabIndex="12"  DataType="Double"></lib:Input>
        </td>
    </tr>
    <tr>
        <td align="right">
            Base Inafecto:</td>
        <td align="right">
             <lib:Input ID="baseInafectoTXT" runat="server" Text='<%# Eval("impInafecto")%>' TabIndex="13" DataType="Double"></lib:Input>
        </td>
    </tr>
    <tr>
        <td align="right">
            IGV <lib:Input ID="IGVValorTXT" runat="server" Text='<%# Eval("IGV")%>' 
            ReadOnly="true"  Width="12px"></lib:Input>  %:</td>
        <td align="right">
             <lib:Input ID="IGVTXT" runat="server" Text='<%# Eval("igvDoc")%>' TabIndex="14" DataType="Double"></lib:Input>
        </td>
    </tr>
    <tr>
        <td align="right">
            ISC:</td>
        <td align="right">
            <lib:Input ID="ISCTXT" runat="server" Text='<%# Eval("impISC")%>' TabIndex="15" DataType="Double"></lib:Input>
        </td>
    </tr>
      <tr>
        <td align="right">
            Total</td>
        <td align="right">
            <lib:Input ID="TotalTXT" runat="server" Text='<%# Eval("totalDoc")%>' TabIndex="16" DataType="Double" />
        </td>
    </tr>
</table>
</asp:Panel>                             

<asp:Panel ID="totalHonorarioPNL" runat="server"  Visible='<%# Eval("isHonorario")%>'>
            <table >
    <tr>
        <td align="right">
            Importe Honorario:</td>
        <td width="100px" align="right">
             <lib:Input ID="honorrarioTXT" runat="server" Text='<%# Eval("totalDoc")%>' TabIndex="17" DataType="Double"></lib:Input>
        </td>
    </tr>
    <tr>
        <td align="right">
            Ret. Renta 4ta:</td>
        <td align="right">
            <lib:Input ID="ren4taTXT" runat="server" Text='<%# Eval("Renta4ta")%>' TabIndex="18" DataType="Double"></lib:Input>
        </td>
    </tr>
    <tr>
        <td align="right">
            Importe Neto:</td>
        <td align="right">
            <lib:Input ID="netoHonorarioTXT" runat="server" Text='<%# Eval("importeNeto")%>' TabIndex="19" DataType="Double"></lib:Input>
        </td>
    </tr>
</table>
</asp:Panel>                             
                          
                                     
                                     
     </EditItemTemplate>

                                      
                                     

                                  </asp:TemplateField>


                                  
   <asp:CommandField ButtonType="Image"  CancelText="Cancelar" ItemStyle-VerticalAlign="Bottom"
                                         EditText="Editar" ShowEditButton="true"
                                          UpdateImageUrl="~/Images/update.gif"
                                        EditImageUrl="~/Images/edit.gif"
                                        CancelImageUrl="~/Images/cancel.gif"
                                        UpdateText="Aceptar" />
                              
                                 <%-- <asp:TemplateField>
                                      <ItemTemplate>
                                       
                                          <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                              CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                              OnClick="DeleteItem" OnClientClick="return confirm('Usted quiere eliminar?')" />
                                       </ItemTemplate>
                                      
                                  </asp:TemplateField>--%>
                              </Columns>
                              </asp:GridView>

<p>
    &nbsp;</p>
